package com.leyou.item.mapper.lymapper;

import com.leyou.item.entity.Sku;
import com.leyou.item.mapper.LyBaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author linzx
 * @date 2020/3/24
 */
public interface SkuMapper extends LyBaseMapper<Sku> {
    /**
     * 坑用不了
     *
     * @param spuId
     * @return
     */
    @Select("SELECT a.id ,a.`enable`,a.images,a.indexes,a.own_spec,a.price,a.spu_id,a.title ,b.stock " +
            "FROM tb_sku a JOIN tb_stock b on b.sku_id = a.id WHERE a.spu_id = #{spuId} ")
    List<Sku> findSkuWithStockBySpuId(@Param("spuId") Long spuId);
}
